package com.nkdx.ws.controller;

import com.nkdx.ws.annotation.Log;
import com.nkdx.ws.response.ApiResponse;
import com.nkdx.ws.service.UserLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 用户日志
 * @author ZZW
 * @date 2022/3/20 11:46 上午
 */
@Controller
@RequestMapping("userLog")
public class UserLogController {

    private UserLogService userLogService;

    @Autowired
    public UserLogController(UserLogService userLogService){
        this.userLogService = userLogService;
    }

    @Log(module = "用户日志",description = "去用户日志页面")
    @RequestMapping("toUserLogList")
    public String toUserLogList(){
        return "userLog/user_log_list";
    }

    @Log(module = "用户日志",description = "查询用户日志")
    @RequestMapping("findAll")
    @ResponseBody
    public ApiResponse findAll(){
        return new ApiResponse().success(userLogService.findAll());
    }
}
